# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.VectorTile.V1.Model.Geometry do
  @moduledoc """
  Represents the geometry of a feature, that is, the shape that it has on the map. The local tile coordinate system has the origin at the north-west (upper-left) corner of the tile, and is scaled to 4096 units across each edge. The height (Z) axis has the same scale factor: an extruded area with a max_z value of 4096 has the same height as the width of the tile that it is on. There is no clipping boundary, so it is possible that some coordinates will lie outside the tile boundaries.

  ## Attributes

  *   `areas` (*type:* `list(GoogleApi.VectorTile.V1.Model.Area.t)`, *default:* `nil`) - The areas present in this geometry.
  *   `extrudedAreas` (*type:* `list(GoogleApi.VectorTile.V1.Model.ExtrudedArea.t)`, *default:* `nil`) - The extruded areas present in this geometry. Not populated if modeled_volumes are included in this geometry unless always_include_building_footprints is set in GetFeatureTileRequest, in which case the client should decide which (extruded areas or modeled volumes) should be used (they should not be rendered together).
  *   `lines` (*type:* `list(GoogleApi.VectorTile.V1.Model.Line.t)`, *default:* `nil`) - The lines present in this geometry.
  *   `modeledVolumes` (*type:* `list(GoogleApi.VectorTile.V1.Model.ModeledVolume.t)`, *default:* `nil`) - The modeled volumes present in this geometry. Not populated unless enable_modeled_volumes has been set in GetFeatureTileRequest.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :areas => list(GoogleApi.VectorTile.V1.Model.Area.t()) | nil,
          :extrudedAreas => list(GoogleApi.VectorTile.V1.Model.ExtrudedArea.t()) | nil,
          :lines => list(GoogleApi.VectorTile.V1.Model.Line.t()) | nil,
          :modeledVolumes => list(GoogleApi.VectorTile.V1.Model.ModeledVolume.t()) | nil
        }

  field(:areas, as: GoogleApi.VectorTile.V1.Model.Area, type: :list)
  field(:extrudedAreas, as: GoogleApi.VectorTile.V1.Model.ExtrudedArea, type: :list)
  field(:lines, as: GoogleApi.VectorTile.V1.Model.Line, type: :list)
  field(:modeledVolumes, as: GoogleApi.VectorTile.V1.Model.ModeledVolume, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.VectorTile.V1.Model.Geometry do
  def decode(value, options) do
    GoogleApi.VectorTile.V1.Model.Geometry.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.VectorTile.V1.Model.Geometry do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
